<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>修改客户贷款信息</title>
		<#include '/frame/version.html'>
		<#include '/frame/manage/include_css.html'>
		<script type="text/javascript" src="${basePath}/js/My97DatePicker/WdatePicker.js"></script>
		<#include '/frame/manage/include_js.html'>
		<#include '/frame/taglib.html'>
	</head>
	<body id="nv_member">
		<#assign current='menu_loan_info'>
		<div id="wp" class="wp">
			<#include "/include/header.html"/>
			<div class="contentmanage">
				<div class="developer">
					<div class="tableContent">
						<#include "/include/left.html"/>
						<#include "/include/wxtop.html"/>
						<div class="content">
							<div class="cLineB">
								<h4 style="font-size:16px;">修改客户贷款信息</h4>
								<div class="pageNavigator right">
		                			<a class="btnGray" type="button" href="${basePath}/admin/loan/index">返回</a>
		               			</div>
							</div>
							<form method="post" action="${basePath}/admin/loan/persist" id="mainForm">
								<input name="loanId" value="${bean.loanId}" type="hidden"/>
								<div class="msgWrap">
									<table class="userinfoArea" width="100%">
										<tbody>
											<tr>
												<th>
													<span class="red">*</span><label for="input_custName">客户姓名：</label>
												</th>
												<td>
													<input type="text" class="px input_width_500" id="custName" value="${bean.custName}" name="custName" maxlength="10" placeholder="请输入客户姓名"/>
												</td>
											</tr>
											<tr>
												<th>
													<span class="red">*</span><label for="input_custIdNum">身份证号：</label>
												</th>
												<td>
													<input type="text" class="px input_width_500" id="custIdNum" value="${bean.custIdNum}" name="custIdNum" maxlength="50" placeholder="请输入身份证号"/>
												</td>
											</tr>
											<tr>
												<th>
													<span class="red">*</span><label for="input_custPhone">手机号：</label>
												</th>
												<td>
													<input type="text" class="px input_width_500" id="custPhone" value="${bean.custPhone}" name="custPhone" maxlength="11" placeholder="手机号"/>
												</td>
											</tr>
											
											<tr>
												<th>
													<span class="red">*</span><label for="input_isLoan">是否放款：</label>
												</th>
												<td>
													<select name="isLoan" >
											              <option value="0" <#if bean.isLoan?exists && bean.isLoan==0>selected</#if>>否</option>
											              <option value="1" <#if bean.isLoan?exists && bean.isLoan==1>selected</#if>>是</option>
					          	 					</select>
												</td>
											</tr>
											
											<tr>
												<th>
													<span class="red">*</span><label for="input_loanDate">放款时间：</label>
												</th>
												<td>
													<input type="text" class="px input_width_500" id="loanDate" <#if bean.loanDate?exists>value="${bean.loanDate?datetime}"</#if> name="loanDate" placeholder="放款时间"
													 onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})"/>
												</td>
											</tr>
											
											<tr>
												<th>
													<span class="red">*</span><label for="input_isCheck">是否已交凭证：</label>
												</th>
												<td>
													<select name="isCheck" >
											              <option value="0" <#if bean.isCheck?exists && bean.isCheck==0>selected</#if>>否</option>
											              <option value="1" <#if bean.isCheck?exists && bean.isCheck==1>selected</#if>>是</option>
					          		 				</select>
												</td>
											</tr>
											
											
											<tr>
												<th valign="top">
													<span class="red">*</span><label for="institutionId">网点机构信息：</label>
												</th>
												<td>
													<input type="text" class="px input_width_500" id="input_keyword" value="" placeholder="请输入机构名称检索"/>
													<input type="button" value="搜索" class="btnGreen" id="input_search"/>
													<div class="div_white_space_5"></div>
													<p>
														<select class="input_width_500" name="loanOrgCode" id="loanOrgCode">
														<#if orgInfo??>
														  <option value='${orgInfo.orgCode}'>${orgInfo.orgName}</option>
														</#if>
														</select>
													</p>
												</td>
											</tr>
											
											
											<tr>
												<th></th>
												<td>
													<input type="button" value="保存" class="btnGreen left" id="input_save"/>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<#include "/include/footer.html"/>
		
<script>
$(function(){
	$("#input_search").on("click",function(){
		var $this = $(this),$keyword = $this.prev();
		var keyword = $keyword.val();
		if(utils.isEmpty(keyword)){
			stem.tip("请输入关键词", $keyword.get(0));
			return;
		}else{
			$.post("${basePath}/admin/loan/ins",{keyword:keyword},function(data){
				if(data!=null&&data.length>0){
					var options = "";
					for(var i=0;i<data.length;i++){
						options += "<option value='"+data[i].code+"'>"+data[i].name+"</option>";
					}
					$("#loanOrgCode").html(options);
				}else{
					stem.msg("无符合的机构信息！");
				}
			},"json");
		}
	});
	$("#input_save").on("click",function(){
		var $custName= $("#custName");
		var $custIdNum = $("#custIdNum");
		var $custPhone = $("#custPhone");
		var $loanOrgCode=$("#loanOrgCode");
		if(utils.isEmpty($custName.val())){
			stem.tip("客户姓名不能为空！",$custName.get(0));
			$custName.focus();
			return false;
		}
		if(utils.isEmpty($custIdNum.val())){
			stem.tip("客户身份证号不能空！", $custIdNum.get(0));
			$custIdNum.focus();
			return false;
		}
		if(utils.isEmpty($custPhone.val())){
			stem.tip("客户手机号不能空！", $custPhone.get(0));
			$custPhone.focus();
			return false;
		}
		if(utils.isEmpty($loanOrgCode.val())){
			stem.tip("机构信息不能空！",$loanOrgCode.get(0));
			$loanOrgCode.focus();
			return false;
		}
		$("#mainForm").submit();
	});
});

</script>
	
	</body>
</html>